﻿using Microsoft.EntityFrameworkCore.Migrations;

namespace LiveShopvnext.Migrations
{
    public partial class vu : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "OrderDiscount",
                table: "CommodOrder");

            migrationBuilder.DropColumn(
                name: "OrderInfoActiveName",
                table: "CommodOrder");

            migrationBuilder.DropColumn(
                name: "OrderInfoActivePrice",
                table: "CommodOrder");

            migrationBuilder.AlterColumn<string>(
                name: "PayWayInfoId",
                table: "CommodOrder",
                type: "nvarchar(max)",
                nullable: true,
                oldClrType: typeof(int),
                oldType: "int");

            migrationBuilder.AlterColumn<string>(
                name: "OrderInfoBarCode",
                table: "CommodOrder",
                type: "nvarchar(max)",
                nullable: true,
                oldClrType: typeof(decimal),
                oldType: "decimal(18,2)");
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AlterColumn<int>(
                name: "PayWayInfoId",
                table: "CommodOrder",
                type: "int",
                nullable: false,
                defaultValue: 0,
                oldClrType: typeof(string),
                oldType: "nvarchar(max)",
                oldNullable: true);

            migrationBuilder.AlterColumn<decimal>(
                name: "OrderInfoBarCode",
                table: "CommodOrder",
                type: "decimal(18,2)",
                nullable: false,
                defaultValue: 0m,
                oldClrType: typeof(string),
                oldType: "nvarchar(max)",
                oldNullable: true);

            migrationBuilder.AddColumn<decimal>(
                name: "OrderDiscount",
                table: "CommodOrder",
                type: "decimal(18,2)",
                nullable: false,
                defaultValue: 0m);

            migrationBuilder.AddColumn<string>(
                name: "OrderInfoActiveName",
                table: "CommodOrder",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<decimal>(
                name: "OrderInfoActivePrice",
                table: "CommodOrder",
                type: "decimal(18,2)",
                nullable: false,
                defaultValue: 0m);
        }
    }
}
